package com.joyintech.enums;

/**
 * 联盟基金 PrdType 产品类型字段
 */
public enum PrdTypeEnum {

    GPXJJ("11","股票型基金"),
    HBSCX("12","货币市场型"),
    CYQCP("13","持有期产品"),
    ZQX("14","债券型"),
    ZSX("15","指数型"),
    QDII("16","QDII"),
    HHX("17","混合型"),
    BBX("18","保本型"),
    FOF("19","FOF"),
    JJZH("20","基金专户"),
    XTJH("21","信托计划"),
    LOF("22","LOF"),
    QTLX("30","其他类型"),
    ;





    private String code;
    private String name;

    PrdTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static PrdTypeEnum getNameByCode(String code) {
        for (PrdTypeEnum codeEnum : PrdTypeEnum.values()) {
            if (codeEnum.getCode().equals(code)) {
                return codeEnum;
            }
        }
        return PrdTypeEnum.QTLX;
    }
}
